import ajax from '@/utils/HttpUtil'
import { baseUrl as API_HOST } from '/env'



/**
 * 删除或批量删除
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/delete'
 */
export const POST_IMAGE_DELETE = API_HOST + '/report/image/delete'

/**
 * 删除或批量删除
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImageDelete(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGE_DELETE,
    ...options
  })
}

/**
 * 详情
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/info/:id'
 */
export const GET_IMAGE_INFO_ID = API_HOST + '/report/image/info/:id'

/**
 * 详情
 * @param {string|number} id Url参数id
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function getImageInfoId(id, data, options) {
  return ajax({
    method: 'get',
    params: {
      id
    },
    data: data,
    url: GET_IMAGE_INFO_ID,
    ...options
  })
}

/**
 * 分页查询
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/list'
 */
export const POST_IMAGE_LIST = API_HOST + '/report/image/list'

/**
 * 分页查询
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImageList(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGE_LIST,
    ...options
  })
}

/**
 * 不分页查询
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/listAll'
 */
export const POST_IMAGE_LIST_ALL = API_HOST + '/report/image/listAll'

/**
 * 不分页查询
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImageListAll(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGE_LIST_ALL,
    ...options
  })
}

/**
 * 新增
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/save'
 */
export const POST_IMAGE_SAVE = API_HOST + '/report/image/save'

/**
 * 新增
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImageSave(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGE_SAVE,
    ...options
  })
}

/**
 * 修改
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/image/update'
 */
export const POST_IMAGE_UPDATE = API_HOST + '/report/image/update'

/**
 * 修改
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postImageUpdate(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_IMAGE_UPDATE,
    ...options
  })
}
